#include <stdio.h>

int main (void)
{
  int guess = 1;
  int response ;

  printf("pick an integer from 1 to 100.I will try to guess. \n");
  printf("respond with 'y' if my guess is right and with 'n' if is no right.\n");
  printf("is your number %d? \n",guess);
  while((response = getchar()) != 'y')
  {
    while(getchar() != '\n');
    if(response == 'n')
      printf("well,then,is it %d ?\n",++guess); 
    else if (response != 'n')
      printf("sorry , i just can understand 'y' or 'n'\n");
  }
  printf("i knew i could do it!\n");

  return 0;
}
